<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="css/console.css" />
		<link rel="stylesheet" type="text/css" href="css/iconfont.css" />
		<link rel="stylesheet" type="text/css" href="js/layer/theme/default/layer.css" />
		<script src="js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/echarts.common.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/layer/layer.js" type="text/javascript" charset="utf-8"></script>
	</head>

	<body>
		<div class="biger">
			<div class="big">
				<div class="box zonglan">
					<div class="box-top">
						<p><i class="iconfont icon-home"></i>&nbsp;总览</p>
					</div>
					<div class="box-main">
						<ul>
							<li>
								<div class="left">
									<p>今日新增</p>
								</div>
								<div class="right">
									<p>平均评价+1000 差评-97</p>
								</div>
							</li>
							<li>
								<div class="left">
									<p>本周新增</p>
								</div>
								<div class="right">
									<p>平均评价+10000.42 差评-927</p>
								</div>
							</li>
							<li>
								<div class="left">
									<p>本月新增</p>
								</div>
								<div class="right">
									<p>平均评价+10086.32 差评-1927</p>
								</div>
							</li>
						</ul>
					</div>
				</div>

				<div class="box daiban">
					<div class="box-top">
						<p><i class="iconfont icon-check"></i>&nbsp;待办事项</p>
					</div>
					<div class="box-main">
						<input type="text" name="" id="" value="" placeholder="新增代办项" />

						<ul class="todoList">
							<li><input type="text" name="" id="todo1" value="1.练手后台管理" /><button class="btn-check" onclick="del('todo1')"><i class="iconfont icon-check"></i></button><button class="btn-del" onclick="del('todo1')"><i class="iconfont icon-delete"></i></button></li>
							<li><input type="text" name="" id="todo2" value="2.练手后台管理" /><button class="btn-check" onclick="del('todo2')"><i class="iconfont icon-check"></i></button><button class="btn-del" onclick="del('todo2')"><i class="iconfont icon-delete"></i></button></li>
							<li><input type="text" name="" id="todo3" value="3.练手后台管理" /><button class="btn-check" onclick="del('todo3')"><i class="iconfont icon-check"></i></button><button class="btn-del" onclick="del('todo3')"><i class="iconfont icon-delete"></i></button></li>

						</ul>
					</div>
				</div>
				<div class="box gongjuxiang">
					<div class="box-top">
						<p><i class="iconfont icon-menu"></i>&nbsp;工具箱</p>
					</div>
					<div class="box-main">
						<ul>
							<li>
								<a href=""><i class="iconfont icon-add"></i></a>
							</li>
							<li>
								<a href=""><i class="iconfont icon-computer"></i></a>
							</li>
							<li>
								<a href=""><i class="iconfont icon-upload"></i></a>
							</li>
							<li>
								<a href=""><i class="iconfont icon-sitting"></i></a>
							</li>

						</ul>
					</div>
				</div>

				<div class="box qudaotongji">
					<div class="box-top">
						<p><i class="iconfont icon-like"></i>&nbsp;渠道统计</p>
					</div>
					<div class="box-main">
						<div id="echarts1">

						</div>
					</div>
				</div>
				<div class="box shishishuju">
					<div class="box-top">
						<p><i class="iconfont icon-order"></i>&nbsp;实时数据</p>
					</div>
					<div class="box-main">
						<div id="echarts2">

						</div>
					</div>
				</div>

			</div>
		</div>
		<script type="text/javascript">
			//加载层

			var index = layer.load(2, {
				shade: false
			}); //0代表加载的风格，支持0-2

			setTimeout(function() {
				layer.close(index);
				$('.biger').css('opacity', '1');

			}, 1000)

			function del(id) {
				$('#' + id + '').parent().remove();
			}

			var myChart1 = echarts.init(document.getElementById('echarts1'));

			var option1 = {
				tooltip: {
					trigger: 'axis',
					axisPointer: { // 坐标轴指示器，坐标轴触发有效
						type: 'shadow' // 默认为直线，可选为：'line' | 'shadow'
					}
				},
				legend: {
					data: ['直接访问', '邮件营销', '联盟广告', '视频广告', '搜索引擎', '百度', '谷歌', '必应', '其他']
				},
				grid: {
					left: '3%',
					right: '4%',
					bottom: '3%',
					containLabel: true
				},
				xAxis: [{
					type: 'category',
					data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
				}],
				yAxis: [{
					type: 'value'
				}],
				series: [{
						name: '直接访问',
						type: 'bar',
						data: [320, 332, 301, 334, 390, 330, 320]
					},
					{
						name: '邮件营销',
						type: 'bar',
						stack: '广告',
						data: [120, 132, 101, 134, 90, 230, 210]
					},
					{
						name: '联盟广告',
						type: 'bar',
						stack: '广告',
						data: [220, 182, 191, 234, 290, 330, 310]
					},
					{
						name: '视频广告',
						type: 'bar',
						stack: '广告',
						data: [150, 232, 201, 154, 190, 330, 410]
					},
					{
						name: '搜索引擎',
						type: 'bar',
						data: [862, 1018, 964, 1026, 1679, 1600, 1570],
						markLine: {
							lineStyle: {
								normal: {
									type: 'dashed'
								}
							},
							data: [
								[{
									type: 'min'
								}, {
									type: 'max'
								}]
							]
						}
					},
					{
						name: '百度',
						type: 'bar',
						barWidth: 5,
						stack: '搜索引擎',
						data: [620, 732, 701, 734, 1090, 1130, 1120]
					},
					{
						name: '谷歌',
						type: 'bar',
						stack: '搜索引擎',
						data: [120, 132, 101, 134, 290, 230, 220]
					},
					{
						name: '必应',
						type: 'bar',
						stack: '搜索引擎',
						data: [60, 72, 71, 74, 190, 130, 110]
					},
					{
						name: '其他',
						type: 'bar',
						stack: '搜索引擎',
						data: [62, 82, 91, 84, 109, 110, 120]
					}
				]
			};

			myChart1.setOption(option1);

			var myChart2 = echarts.init(document.getElementById('echarts2'));

			var option2 = {
				title: {
					text: ''
				},
				tooltip: {
					trigger: 'axis',
					axisPointer: {
						type: 'cross',
						label: {
							backgroundColor: '#6a7985'
						}
					}
				},
				legend: {
					data: ['邮件营销', '联盟广告', '视频广告', '直接访问', '搜索引擎']
				},
				toolbox: {
					//					feature: {
					//						saveAsImage: {}
					//					}
					//					保存为图片
				},
				grid: {
					left: '3%',
					right: '4%',
					bottom: '3%',
					containLabel: true
				},
				xAxis: [{
					type: 'category',
					boundaryGap: false,
					data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
				}],
				yAxis: [{
					type: 'value'
				}],
				series: [{
						name: '邮件营销',
						type: 'line',
						stack: '总量',
						areaStyle: {},
						data: [120, 132, 101, 134, 90, 230, 210]
					},
					{
						name: '联盟广告',
						type: 'line',
						stack: '总量',
						areaStyle: {},
						data: [220, 182, 191, 234, 290, 330, 310]
					},
					{
						name: '视频广告',
						type: 'line',
						stack: '总量',
						areaStyle: {},
						data: [150, 232, 201, 154, 190, 330, 410]
					},
					{
						name: '直接访问',
						type: 'line',
						stack: '总量',
						areaStyle: {
							normal: {}
						},
						data: [320, 332, 301, 334, 390, 330, 320]
					},
					{
						name: '搜索引擎',
						type: 'line',
						stack: '总量',
						label: {
							normal: {
								show: true,
								position: 'top'
							}
						},
						areaStyle: {
							normal: {}
						},
						data: [820, 932, 901, 934, 1290, 1330, 1320]
					}
				]
			};

			myChart2.setOption(option2);

			var time1 = setInterval(function() {
				
				var i = 0;
				i++;
				option2.series.push({
					name: '动态数据'+i,
					type: 'line',
					stack: '总量',
					data: [parseInt(Math.random()*300), parseInt(Math.random()*200), parseInt(Math.random()*150), parseInt(Math.random()*200), parseInt(Math.random()*200), parseInt(Math.random()*200), parseInt(Math.random()*200)],
					
				});
				
				option2.series.splice(i,1);
				if(i>6){
					clearInterval(time1);
				}
				myChart2.setOption(option2, true);
			}, 5000);
		</script>
	</body>

</html>